package com.o2o.service;

import com.o2o.dto.ImageHolder;
import com.o2o.dto.ProductExecution;
import com.o2o.entity.Product;
import com.o2o.exceptions.ProductOperationException;

import java.util.List;

/**
 * package_name:com.o2o.service
 * Author:徐亚远
 * Date:2019/12/17 12:43
 * 项目名:o2o
 * Desription:
 **/
public interface ProductService {

    /*
    * 查询商品列表并分页,可输入的条件有:商品名(模糊),商品状态,店铺id,商品类别
    * @param productCondition
    * @param pageIndex
    * @param pageSize
    * @return
    * */
    ProductExecution getProductList(Product productCondition, int pageIndex, int pageSize);


    /*
     * 添加商品信息以及图片处理
     *@param product
     * @param thumbnail
     * @param productImg
     * @return
     * @throws productOperationException
     * */
    ProductExecution addProduct(Product product,
                                ImageHolder thumbnail,
                                List<ImageHolder> productImgList
    ) throws ProductOperationException;


    /*
     * 修改商品信息以及图片处理
     *@param product
     * @param thumbnail
     * @param productImg
     * @return
     * @throws productOperationException
     * */
    ProductExecution modifyProduct(Product product,
                                   ImageHolder thumbnail,
                                   List<ImageHolder> productImgList
    ) throws ProductOperationException;

    /*
    * 通过商品Id查询唯一的商品信息
    * @param productId
    * @return
    * */
    Product getProductById(Long productId);
}
